<?php $content = '$(function(){$("input[name=keywords]").autocomplete({source:"includes/javascript/helper/autocomplete.php",minLength:2,width:300,focus:function(event,ui){$("input[name=keywords]").val(ui.item.name);return false;},open: function(){$(".ui-autocomplete").width(280);},select: function(event, ui){';if($_GET['sbac']=='result'){$content.='$("input[name=keywords]").attr("value", ui.item.name);$("#quick_find").submit();';}elseif($_GET['sbac']=='link'){$content.="window.location.href='product_info.php?products_id='+ui.item.id";}$content.="}}).data(\"autocomplete\")._renderItem=function(ul,item){if(item.img!=''){var image='<span class=\"autocomplete_img\"><img  class=\"img_search\" src=\"'+item.img+'\"></span>';}else{var image='';}return $(\"<li></li>\").data(\"item.autocomplete\",item).append(\"<a class='clearfix'>\"+image+\"<span class='db' style='float:right;text-align:left;width:200px'>\"+item.name+\"</span></a><br />\").appendTo(ul);};});";